﻿@using Partner.Surround.Admin.Views
@{
    ViewBag.CurrentPageName = SurroundPageName.Roles;
}

<div class="layui-card">
    <div class="layui-card-body">
        <table id="role-table" lay-filter="role-table"></table>
    </div>
</div>

<script type="text/html" id="roleCardItem">
    <div class="layui-col-md3 ew-datagrid-item">
        <div class="project-list-item" data-index="0" data-number="1">
            <div class="project-list-item-body">
                <h2>{{d.name}}</h2>
                <div class="project-list-item-text layui-text">{{d.description}}</div>
            </div>
        </div>
    </div>
</script>

@section scripts{
    <script type="text/javascript">
        layui.use(['abp', 'form', 'card'], function () {
            var $ = layui.$;
            var abp = layui.abp;
            var card = layui.card;

            card.render({
                elem: '#role-table',
                url: "@Url.Action("GetRoleList", "Roles")",
                template: '#roleCardItem',
                layout: ['count', 'prev', 'page', 'next'],
                parseData: function (res) {
                    return {
                        "code": res.result.code, //解析接口状态
                        "msg": res.result.msg, //解析提示文本
                        "count": res.result.count, //解析数据长度
                        "data": res.result.data //解析数据列表
                    };
                }
            })
        });
    </script>
}